<%@ page import="com.atguigu.pojo.User" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--
  EL表达式取出域对象的数据，数据存储的是pojo对象,
  pojo对象存储List集合
--%>
<%
    User user1 = new User(1,"张三","123");
    User user2 = new User(2,"李四","456");
    List<User> userList = new ArrayList<User>();
    userList.add(user1);
    userList.add(user2);
    //user对象，存储在request的域对象中
    request.setAttribute("userList",userList);
%>

<%--EL表达式取出集合中的数据--%>
${userList[0].id}  ${userList[0].username}  ${userList[0].password} <br>
${userList[1].id}  ${userList[1].username}  ${userList[1].password} <br>
</body>
</html>
